

/**
 * Filters for packets of a specific type of Message (e.g. CHAT).
 * 
 * @see org.jivesoftware.smack.packet.Message.Type
 * @author Ward Harold
 */
class MessageTypeFilter : public PacketFilter {
public:

    /**
     * Creates a new message type filter using the specified message type.
     * 
     * @param type the message type.
     */
    MessageTypeFilter(Message::Type type) : type(type){ }
	bool accept(Packet * packet) {
		return (typeid(*packet) == typeid(Message)) != 0 &&  (Message*)packet->getType() == type;
	}
private:
	Message::Type type;
};
